#ifndef __EPD_H__
#define __EPD_H__

#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "epd_types.h"
#include "epd_io.h"

#define EPD_DRIVER_TYPE  EPD_DRIVER_9IN7_BW   /*屏幕驱动选择*/

#if (EPD_DRIVER_TYPE == EPD_DRIVER_9IN7_BW)
#define EPD_GAMUT  EPD_BW
#define EPD_WIDTH  960
#define EPD_HEIGHT 672
#endif

typedef struct epd_driver_s {
    void (*init)(void);
    void (*refresh)(epd_refresh_t type);
    void (*select_ram)(epd_ram_t type);
    void (*select_window)(uint16_t x_start, uint16_t y_start, uint16_t width, uint16_t *height);
    void (*select_cursor)(uint16_t x_start, uint16_t y_start);
    void (*send_data_block)(uint8_t *data, uint32_t size);
    int8_t (*read_temp)(void);
} epd_driver_t;

void epd_device_init(void);
void epd_device_refresh(epd_refresh_t refresh);
void epd_device_write_image(uint16_t x_start, uint16_t y_start, uint16_t width, uint16_t height, uint8_t *data, bool full_update);
int8_t epd_device_read_temp(void);

#endif // __EPD_H__